SELECT
<#assign prefixName=' '>
<#if (select__id??)>
${prefixName} T.ID AS id
	<#assign prefixName=','>
</#if>
<#if (select__message??)>
${prefixName} T.MESSAGE AS message
	<#assign prefixName=','>
</#if>
<#if (select__operatorDa??)>
${prefixName} T.OPERATOR_DA AS operatorDa
	<#assign prefixName=','>
</#if>
<#if (select__operatorId??)>
${prefixName} T.OPERATOR_ID AS operatorId
	<#assign prefixName=','>
</#if>
<#if (select__entityId??)>
${prefixName} T.ENTITY_ID AS entityId
	<#assign prefixName=','>
</#if>
<#if (select__code??)>
${prefixName} T.CODE AS code
	<#assign prefixName=','>
</#if>
<#if prefixName == ' '>
  T.ID AS id
, T.MESSAGE AS message
, T.OPERATOR_DA AS operatorDa
, T.OPERATOR_ID AS operatorId
, T.ENTITY_ID AS entityId
, T.CODE AS code
</#if>
FROM FD_RESOURCE_LO T
<#include "whereResourceLoBy1.ftl">
<#assign prefixName='ORDER BY'>
<#if (order__by__id??)>
${prefixName} T.ID ${order__by__id__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__message??)>
${prefixName} T.MESSAGE ${order__by__message__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__operatorDa??)>
${prefixName} T.OPERATOR_DA ${order__by__operatorDa__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__operatorId??)>
${prefixName} T.OPERATOR_ID ${order__by__operatorId__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__entityId??)>
${prefixName} T.ENTITY_ID ${order__by__entityId__value!}
	<#assign prefixName=','>
</#if>
<#if (order__by__code??)>
${prefixName} T.CODE ${order__by__code__value!}
	<#assign prefixName=','>
</#if>
